package org.spring.aicloud.mapper;

import org.apache.ibatis.annotations.Select;
import org.spring.aicloud.entity.Comment;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.spring.aicloud.vo.CommentVO;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author yexiebao
 * @since 2025-05-20
 */
public interface CommentMapper extends BaseMapper<Comment> {
    @Select("SELECT c.*,u.username FROM `comment` c LEFT JOIN `user` u ON c.uid = u.uid" +
            " WHERE c.did = #{did} ORDER BY cid DESC")
    List<CommentVO>getCommentList(@RequestParam("did") Long did);
}
